The present disclosure relates to a virtual memory system, a virtual memory controlling method, and a program compatible with a nonvolatile random access memory that is nonvolatile, which has an upper limit to the number of times of rewriting, and which allows random access.
A current virtual memory system is formed by a memory management unit referred to as an MMU (Memory Management Unit) and virtual memory control software implemented as a function of an operating system.
The virtual memory system having such a configuration is used in various systems as a system intended for the physical memory space of a DRAM as a volatile memory.
The virtual memory system divides and manages the physical memory (physical address) space in page units. An application that needs memory requests and secures a necessary virtual page from the virtual memory system in advance before using the virtual page. This is referred to as demand paging.
In the virtual memory system, only a necessary memory capacity is secured. Thus, a limited physical memory capacity can be used efficiently. In addition, access to the physical memory space is made using a virtual address space independent for each application.
The virtual memory system therefore provides an advantage of allowing an arrangement of discontinuous physical pages in the physical address space to be accessed as a continuous virtual page space in the virtual address space.
In addition, when there is a shortage of capacity in the physical memory space for an application being executed, a process referred to as a swap-out process is performed which process writes the data of a physical page assigned to a virtual page determined to be used with a lowest frequency to a storage (swap area) such as a hard disk or the like. Thereafter the physical page is assigned as an unused physical page to a virtual address requested by the application. Thereby the shortage of the physical memory space can be supplied.
When access to the data of the page saved to the swap area in the storage occurs, a process (swap-in) of assigning a physical page to the virtual address of the data again and reading the data from the swap area is performed. Thereby the data can be accessed as data in virtual memory again.
These swap-out and swap-in processes at the time of occurrence thereof involve the occurrence of access to the storage and data transfer between the memory and the storage, and thus cause a temporary degradation in system performance as viewed from an application. However, the swap-out and swap-in processes have an advantage of enabling an application to be executed without being limited by the physical memory capacity.
Japanese Patent Laid-Open No. 2007-188499 proposes a technique for improving system performance.
This technique uses a nonvolatile memory typified by a NAND flash memory in a present situation as a high-speed storage, thereby increasing the speed of the loading of code and data and processes of demand paging such as the swap-out and the swap-in described above, and thus improving system performance.
However, unlike the NAND flash memory, nonvolatile memory devices such as a PCM, a ReRAM, and the like under development as next-generation memories have a feature of allowing high-speed random access in word units as in an SRAM and a DRAM.
When the feature of nonvolatility of such a nonvolatile random access memory is utilized, the nonvolatile random access memory not only can form a higher-speed storage than a NAND flash memory but also makes it possible to realize a high-speed system with low power consumption by replacing a DRAM as a work memory.